<template>
	<view class="container">
		<view class="tip">
			<view class="icon">
				<image class="records_icon" :src="'../../static/images/milk/' + (recordsData.payStatus == 0 ? 'comeon' : 'fail') + '.png'" mode=""></image>
			</view>
			<view class="title">{{recordsData.payStatus == 0 ? ('支付成功！支付' + recordsData.amount + '元') : ('支付失败！' + (recordsData.payMsg?recordsData.payMsg:''))}}</view>
		</view>
		<view class="btn_box">
			<button type="primary" :class="'btn ' + (recordsData.payStatus == 0 ? 'btn_pri' : 'btn_err')" style="background-color: #477EDA;" @click="confirm">确 认</button>
		</view>
		<!-- <view class="testMsg">
			{{massage}}
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				recordsData: {},
				massage: ""
			};
		},
		onLoad(option){
			this.massage = option.recordsData
			this.recordsData = JSON.parse(option.recordsData)
		},
		methods:{
			confirm(){
				if (this.recordsData.payStatus == 0){
					uni.reLaunch({
						url: '../../pageMilk/index/index'
					})
				}else {
					uni.navigateBack({
						delta: 1
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.container{
		padding: 128rpx 24rpx;
	}
	.tip{
		.icon{
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.title{
			margin: 24rpx;
			text-align: center;
		}
	}
	.records_icon{
		width: 128rpx;
		height: 128rpx;
	}
	.btn_box {
		display: flex;
		justify-content: center;
		align-items: center;
		.btn{
			width: 566rpx;
			height: 80rpx;
			line-height: 80rpx;
			font-size: 32rpx;
			box-shadow: 0 16rpx 32rpx 0 rgba(36, 98, 255, 0.24);
			border-radius: 9rpx;
			margin-top: 50rpx;
			&.btn_pri {
				background: linear-gradient(90deg, #0685FF 0%, #285EFF 100%);
			}
			&.btn_err{
				background: linear-gradient(90deg, #d73c13 0%, #d81e06 100%);
			}
		}
	}
	.testMsg{
		width: 88%;
		padding: 24rpx;
		word-wrap: break-word;
		white-space: pre-line;
	}
</style>
